MAIN.C
extern int alarm;
void main(void)
{
TIMEREC Time;
TmDt1_GetTime( &Time ); /* get current time */
/* set alarm one minute later */
TmDt1_SetAlarm( Time.Hour, Time.Min+1, Time.Sec, Time.Sec100 );
/* wait till the alarm event (alarm flag is set) */
while( !alarm );
}
EVENT.C
int alarm = 0;
void TmDt1_OnAlarm(void)
{
alarm = 1; /* set alarm flag in the alarm event handler */
}
For more about typical usage of the bean code please refer to the page Bean Code Typical Usage.